package com.zhanghe.mall.service.vo;

import com.zhanghe.mall.pojo.Manager;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

public class ManagerInfoVO {

    public String name;

    public String userName;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
    public static ManagerInfoVO transfrom(Manager manager){
        ManagerInfoVO vo = new ManagerInfoVO();
        BeanUtils.copyProperties(manager,vo);
        return vo;
    }
    public static List<ManagerInfoVO> transfromByList(List<Manager> managers){
        List<ManagerInfoVO> result = new ArrayList<>();
        for(Manager manager:managers){
            ManagerInfoVO vo = new ManagerInfoVO();
            BeanUtils.copyProperties(manager,vo);
            result.add(vo);
        }
        return result;
    }
}
